<?php
class Admin_Form_DateSelect extends Zend_Form {

	protected $_date;
	protected $_submit;

	public function init() {
		$this->_date = new ZendX_JQuery_Form_Element_DatePicker('date',
		array('jQueryParams' => array('dateFormat' => 'yy-mm-dd','showWeek'=>false))
		);
		$this->_date->setDecorators(array('UiWidgetElement'));

		$this->_submit = new Zend_Form_Element_Submit('submit');
		$this->_submit->setLabel('Go')
		->setDecorators(array('ViewHelper'));
		$this->setDecorators( array(
			array( 'ViewScript', array( 'viewScript' => 'forms/dateselect.phtml' ) )
		) );
		$this->addElements(array($this->_date, $this->_submit));
	}

	public function populateData($date) {
		if (isset($date)) {
			$this->_date->setValue($date);
		}
	}
}